#include<bits/stdc++.h>
using namespace std;
char a[1000005];
int n;
int vis[105][105];
void dfs(int step,int x,int y)
{
	if(step==n+1)
	{
		cout<<"\n";
		return;
	}
	int nx=x,ny=y-1;
	if(ny>=1&&ny<=100&&!vis[nx][ny])
	{
		vis[nx][ny]=1;
		cout<<"L";
		dfs(step+1,nx,ny);
		return;
	}
	nx=x,ny=y+1;
	if(ny>=1&&ny<=100&&!vis[nx][ny])
	{
		vis[nx][ny]=1;
		cout<<"R";
		dfs(step+1,nx,ny);
		return;
	}
	nx=x+1,ny=y;
	if(nx>=1&&nx<=100&&!vis[nx][ny])
	{
		cout<<"D";
		vis[nx][ny]=1;
		dfs(step+1,x,y);
		return;
	}
}
int f;
char ans[1000005];
void dfs1(int step,int x,int y)
{
	if(f) return;
	if(step==n+1)
	{
		f=1;
		for(int i=1;i<=100;++i)
		{
			for(int j=1;j<=100;++j)
			   if(vis[i][j]) cout<<(char)(vis[i][j]);
			   else cout<<"R";
			cout<<"\n";
		}
		cout<<"30 30\n";
		for(int i=1;i<=n;++i) cout<<ans[i];
		cout<<"\n";
		return;
	}
	int nx,ny;
	nx=x+1,ny=y;
	if(nx>=1&&nx<=100&&ny>=1&&ny<=100&&(!vis[nx][ny]||vis[nx][ny]==a[step]))
	{
		ans[step-1]='D';
		if(vis[nx][ny]) dfs1(step+1,nx,ny);
		else vis[nx][ny]=a[step],dfs1(step+1,nx,ny),vis[nx][ny]=0;
	}
	nx=x,ny=y-1;
	if(nx>=1&&nx<=100&&ny>=1&&ny<=100&&(!vis[nx][ny]||vis[nx][ny]==a[step]))
	{
		ans[step-1]='L';
		if(vis[nx][ny]) dfs1(step+1,nx,ny);
		else vis[nx][ny]=a[step],dfs1(step+1,nx,ny),vis[nx][ny]=0;
	}
	nx=x,ny=y+1;
	if(nx>=1&&nx<=100&&ny>=1&&ny<=100&&(!vis[nx][ny]||vis[nx][ny]==a[step]))
	{
		ans[step-1]='R';
		if(vis[nx][ny]) dfs1(step+1,nx,ny);
		else vis[nx][ny]=a[step],dfs1(step+1,nx,ny),vis[nx][ny]=0;
	}
	nx=x-1,ny=y;
	if(nx>=1&&nx<=100&&ny>=1&&ny<=100&&(!vis[nx][ny]||vis[nx][ny]==a[step]))
	{
		ans[step-1]='U';
		if(vis[nx][ny]) dfs1(step+1,nx,ny);
		else vis[nx][ny]=a[step],dfs1(step+1,nx,ny),vis[nx][ny]=0;
	}
}
void dfs2(int step,int x,int y)
{
	if(f) return;
	if(step==n+1)
	{
		f=1;
		for(int i=1;i<=30;++i)
		{
			for(int j=1;j<=30;++j)
			   if(vis[i][j]) cout<<(char)(vis[i][j]);
			   else cout<<"R";
			cout<<"\n";
		}
		cout<<"1 1\n";
		for(int i=1;i<=n;++i) cout<<ans[i];
		cout<<"\n";
		return;
	}
	int nx,ny;
	nx=x+1,ny=y;
	if(nx>=1&&nx<=30&&ny>=1&&ny<=30&&(!vis[nx][ny]||vis[nx][ny]==a[step]))
	{
		ans[step-1]='D';
		if(vis[nx][ny]) dfs1(step+1,nx,ny);
		else vis[nx][ny]=a[step],dfs1(step+1,nx,ny),vis[nx][ny]=0;
	}
	nx=x,ny=y-1;
	if(nx>=1&&nx<=30&&ny>=1&&ny<=30&&(!vis[nx][ny]||vis[nx][ny]==a[step]))
	{
		ans[step-1]='L';
		if(vis[nx][ny]) dfs1(step+1,nx,ny);
		else vis[nx][ny]=a[step],dfs1(step+1,nx,ny),vis[nx][ny]=0;
	}
	nx=x,ny=y+1;
	if(nx>=1&&nx<=30&&ny>=1&&ny<=30&&(!vis[nx][ny]||vis[nx][ny]==a[step]))
	{
		ans[step-1]='R';
		if(vis[nx][ny]) dfs1(step+1,nx,ny);
		else vis[nx][ny]=a[step],dfs1(step+1,nx,ny),vis[nx][ny]=0;
	}
	nx=x-1,ny=y;
	if(nx>=1&&nx<=30&&ny>=1&&ny<=30&&(!vis[nx][ny]||vis[nx][ny]==a[step]))
	{
		ans[step-1]='U';
		if(vis[nx][ny]) dfs1(step+1,nx,ny);
		else vis[nx][ny]=a[step],dfs1(step+1,nx,ny),vis[nx][ny]=0;
	}
}
signed main()
{
	freopen("snake.in","r",stdin);
	freopen("snake.out","w",stdout);
	scanf("%s",a+1);n=strlen(a+1);
	if(n<=10000)
	{
		cout<<"100 100\n";
		for(int i=n+1;i<=10000;++i) a[i]='R';
		int h=100,w=100;
		for(int i=1;i<=100;++i)
		{
			for(int j=1;j<=100;++j)
			{
				if(i%2!=0) cout<<a[(i-1)*100+j];
				else cout<<a[i*100-j+1];
			}
			cout<<"\n";
		}
		cout<<"1 1\n";
		vis[1][1]=1;
		dfs(2,1,1);
		return 0;
	}
	if(n<=15000)
	{
		cout<<"100 100\n";
		vis[30][30]=a[1];
		dfs1(2,30,30);
		return 0;
	}
	if(n>15000)
	{
		cout<<"30 30";
		vis[1][1]=a[1];
		dfs2(2,1,1);
		return 0;
	}
	return 0;
}

